<?php
/**
 * Created by PhpStorm.
 * User: xuzhong
 * Date: 2025/4/3
 * Time: 11:30
 */
namespace app\api\model;
use think\Model;

class Message extends Model
{
    // 定义数据表名
    protected $name = 'message';

    // 定义主键
    protected $primaryKey = 'id';

    // 定义创建时间字段名
    protected $createTime = 'create_time';


    // 定义自动时间戳
    protected $autoWriteTimestamp = true;

    // 设置字段信息
    protected $schema = [
        'id' => 'int',
        'title' => 'string',
        'content' => 'string',
        'fullname' => 'string',
        'email' => 'string',
        'whatsapp' => 'string',
        'mtype' => 'int',
        'status' => 'int',
        'create_time' => 'datetime',
        'creator' => 'int',
        'is_del' => 'int',
    ];
    protected $attributes = [
        'status'=>[
            0=>'未处理',
            1=>'已处理'
        ],
        'mtype'=>[
            1=>'咨询',
            2=>'投诉',
            3=>'联系我们',
        ],
    ];




}